<?php
session_start();
require "lib/db.php";
require "lib/product-function.php";
require "lib/category-function.php";
require "lib/subcategory-function.php";

if(isset($_GET['categoryID'])){
	$categoryID = $_GET['categoryID'];
	$listSubCategory = getListSubCategoryByCategoryID($categoryID);
	echo '<option value="0">--Choose--</option>';
	if(mysql_num_rows($listSubCategory)==0){
		echo '<option value="0">Empty</option>';
	}else{
		while($subCategory = mysql_fetch_array($listSubCategory)){
		echo '<option value="'.$subCategory['SubCategoryID'].'">'.$subCategory['SubCategoryName'].'</option>';
		}
	}	
}
?>